package com.mingzhi.order.fegin;

import com.mingzhi.order.fegin.fallback.ProductFeignClientFallback;
import com.mingzhi.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "service-product",fallback = ProductFeignClientFallback.class)  //FeignClient 默认是使用RestTemplate进行远程调用的  客户端
public interface ProductFeginClient {

    /**
     * 远程调用
     */
    @GetMapping("/api/product/{id}")
    Product getProductById(@PathVariable("id") Long id);
}
